/* Definitions for MMC/SDC command */
#define CMD0	(0x40+0)	/* GO_IDLE_STATE */
#define CMD1	(0x40+1)	/* SEND_OP_COND (MMC) */
#define	ACMD41	(0xC0+41)	/* SEND_OP_COND (SDC) */
#define CMD8	(0x40+8)	/* SEND_IF_COND */
#define CMD16	(0x40+16)	/* SET_BLOCKLEN */
#define CMD17	(0x40+17)	/* READ_SINGLE_BLOCK */
#define CMD24	(0x40+24)	/* WRITE_BLOCK */
#define CMD55	(0x40+55)	/* APP_CMD */
#define CMD58	(0x40+58)	/* READ_OCR */


/* DEFINE SPI Corentin ALTEPE */
#define xmit_spi		SPIWrite
#define rcv_spi			SPIRead

#define SD_CS 			PORTBbits.RB15
#define SD_CS_DIR 		TRISBbits.TRISB15

#define SDI 			PORTFbits.RF7
#define SDI_DIR 		TRISFbits.TRISF7
#define SCK 			PORTFbits.RF6
#define SCK_DIR 		TRISFbits.TRISF6
#define SDO 			PORTFbits.RF8
#define SDO_DIR 		TRISFbits.TRISF8

/* USI control functions (Defined in usi.S, Platform dependent) */
// void xmit_spi (BYTE);	/* Send a byte */
// BYTE rcv_spi (void);	/* Send 0xFF and receive a byte */



/* Port Controls (Platform dependent) Corentin ALTEPE */
#define SELECT()	SD_CS = 0			/* MMC CS = L */
#define	DESELECT()	SD_CS = 1			/* MMC CS = H */
#define	MMC_SEL		PORTFbits.RF7 == 1	/* MMC CS status (true:selected) */
#define	INIT_SPI()	InitSPI()			/* Initialize SPI port */


